vcScope
A container for statements.
See in: Overview
Module: vcExecutor2
Parent: -
Children -
Referenced by: vcIfStatement.ElseScope, vcIfStatement.ThenScope, vcMultiScopeContainer.Scopes, vcMultiScopeContainer.copyScope(), ... (see more)
vcIfStatement.ElseScope
vcIfStatement.ThenScope
vcMultiScopeContainer.Scopes
vcMultiScopeContainer.copyScope()
vcMultiScopeContainer.createScope()
vcRoutine.Scope
vcSingleScopeContainer.Scope
vcStatement.ParentScope
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Name | String | RW | Gets or sets the name for the scope. |
| Parent | vcObject | R | vcExecutor2.vcRoutine | vcExecutor2.vcStatement: Gets the parent of the scope. Exceptions: RuntimeError: When internal error occurs because of orphan scope." |
| Routine | vcRoutine | R | Gets the owner routine. |
| Statements | vcList[vcStatement] | R | list[vcExecutor2.vcStatement]: Gets the contained statements. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| clearStatements | None | None | Deletes every statement in the scope. Parameters: None Returns: None |
| copyStatement | vcStatement | vcStatement statement, Integer index | Clones the statement within or into this scope.See moreParameters: statement (vcExecutor2.vcStatement): A statement to clone. index (int): Index to insert the statement to. Must be zero or positive. If index is greater than the number of contained statements, the cloned statement is added to the end. Returns: vcExecutor2.vcStatement: The copied instance. Exceptions: RuntimeError: When copying fails due to incompatible statement. |
| createStatement | vcStatement | String type, Optional Keyword[index = Integer] | Creates and adds a new statement into the scope.See moreParameters: type (str): Type name of the statement. Optional: index (int): Index to add the statement to. Must be zero or positive. If index not given or is greater than the number of contained statements, the statement is added to the end. Returns: vcExecutor2.vcStatement: The new statement. Exceptions: ValueError: When the type name is invalid or creation fails. |
| delete | None | None | " Deletes the scope. Only certain scopes can be deleted. See moreParameters: None Returns: None Exceptions: TypeError: When scope cannot be deleted. |
| moveStatement | None | vcStatement statement, Integer index | Relocates the statement within or into this scope.See moreParameters: statement (vcExecutor2.vcStatement): A statement to move index (int): Index to move the statement to. Must be zero or positive. If index is greater than the number of contained statements, the statement is moved to the end. Returns: None Exceptions: RuntimeError: When move fails due to incompatible statement. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnStatementAdded | vcStatement statement | Invoked when a statement is added to the scope. Parameters: statement (vcExecutor2.vcStatement): The newly added statement. |
| OnStatementRemoving | vcStatement statement | Invoked when a statement is about to be removed from the scope.See moreParameters: statement (vcExecutor2.vcStatement): The statement about to be removed. |